package main.java.game.command;


import java.util.List;

import main.java.game.Game;
import main.java.game.item.Treasure;

public class SellTreasure implements PlayerCommand {

	private Game game;
	private Treasure treasure;
	public SellTreasure(Game game, Treasure treasure){
		this.treasure = treasure;
		this.game = game;
	}
	public void execute() {
		
		Integer level=treasure.getLevel();
		List<Treasure> listT=game.getTreasures().get(level);
		listT.add(treasure);
		game.getPlayer().getTreasures().remove(treasure);
		game.getPlayer().setGold(game.getPlayer().getGold()+treasure.getSellingPrice());
		

	}

}
